package com.itany.shop.service;

import com.itany.shop.entity.Order;
import com.itany.shop.entity.User;
import com.itany.shop.exception.ServiceException;
import com.itany.shop.exception.UserNotLoginException;
import com.itany.shop.vo.Cart;

import java.util.List;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public interface OrderService {
    /**
     * 生成订单，保存订单号
     * 多表保存
     * @param cart
     * @param user
     */
    String createNo(Cart cart, User user) throws UserNotLoginException;

    /**
     * 根据id查订单
     * @param userId
     * @return
     */
    List<Order> findOrderIdsAndNosByUserId(Integer userId) throws ServiceException;
}
